/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ca.qc.bdeb.info.application;

import ca.qc.bdeb.info.controleur.ConnexionBD;
import ca.qc.bdeb.info.controleur.ConstantesWeb;
import java.sql.ResultSet;

/**
 *
 * @author Usager
 */
public class UserDAO {

    public static ResultSet getUsager(final String user, final String pwd) {
        final String query = "select id, username, AES_DECRYPT(password,'" + ConstantesWeb.CLE_CRYPTAGE
                + "') pwd from user where username = '" + user + "' and password = AES_ENCRYPT('"
                + pwd + "','" + ConstantesWeb.CLE_CRYPTAGE + "')";
        ConnexionBD con;
        ResultSet set = null;
        
        try {
            con = new ConnexionBD();
            set = con.queryExec(query);
        } catch (Exception e) {
        }      
        return set;
    }   
}
